<!doctype html>
<html>
<head>
    <title>攻略</title>
    <?php $this->load->module('admin/index/page_header');?>
</head>
<body>
<div class="wrap J_check_wrap">
    <div class="h_a">功能说明</div>
    <div class="prompt_text">
        游记攻略，分享您在旅游过程中的点点滴滴。
    </div>
    <div class="h_a">搜索</div>
    <div class="search_type cc mb10">
        <form action="<?php $form_url;?>" method="get">
            <div class="ul_wrap">
                <label>攻略标题：</label>
                <input type="text" class="input length_3" name="subject"  value="<?php if(!empty($condition['subject'])) echo $condition['subject'] ; ?>">
                <input type="checkbox" value="1" <?php if($condition['only']=='1') echo "checked" ;?> name="only">只看本站
                <button class="btn" type="submit">搜索</button>
           </div>
      </form>
   </div>
    <div class="mb10">
        <a class="btn btn_submit J_ajax_submit_btn" href="<?php echo site_url('trips/admin/add');?>">添加攻略</a>
    </div>
    <?php if(empty($list)){ ?>
        <div class="not_content_mini"><i></i>还没有攻略！</div>
    <?php }else{?>
        <div class="table_list">
        <table width="100%">
            <thead>
                <tr>
                    <td>id</td>
                    <td>标题</td>
                    <td>分类</td>
                    <td>更新人/时间</td>
                    <td>浏览量</td>
                    <td>操作</td>
                </tr>
            </thead>
            <?php foreach ($list as $k => $v) { ?>
            <tr>
                <td>
                   <?php echo $v['id'];?>
                </td>
                <td>
                    <?php echo '<a href="#">'.$v['subject'].'</a>','<div class="fun_tips">',$v['dist_str'],'</div>'?>
                </td>
                <td><?php echo $v['category_row']['name']?></td>
                <td><?php echo $v['upuser']?> / <?php echo date('Y-m-d H:i', $v['upts'])?></td>
                <td><?php echo $v['view']?></td>

                <td>
                    <a target="_blank" href="<?php echo site_url('mobile/trips/profile/?id='.$v['id']);?>">预览</a>
                    <?php $admin_id =  $this->session->userdata('admin_user_id');?>
                    <?php if($v['sid']==$sid or $admin_id==47):?>
                    <a href="<?php echo site_url('trips/admin/edit/?id='.$v['id']);?>">修改</a>
                    <?php endif;?>
                    <?php if($v['sid']==$sid):?>
                    <a class="doDel" href="javascript:;" data-uri="<?php echo site_url('trips/admin/del/?id='.$v['id']);?>">删除</a>
                    <?php endif;?>
                </td>

            </tr>
            <?php }?>
        </table>
        </div>
        <div class="page_nav">
            <?php echo $this->mypageclass->show(2); ?>
        </div>
    <?php }?>
</div>
</body>
</html>